#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author：albert time:2019/9/11
from aip import AipSpeech
import  requests

""" 你的 APPID AK SK """
APP_ID = '17229182'
API_KEY = 'GyZcXPBDO8hQ8E2mFzMxZSYd'
SECRET_KEY = 'WBHKnjTG2vbVAdTtvinSXm193wMGStE1'

client = AipSpeech(APP_ID, API_KEY, SECRET_KEY)
# token
# access_token":"24.29f64d7b0f0b66f7c1fc8705e41c2e28.2592000.1570788070.282335-17229182"
# "https://openapi.baidu.com/oauth/2.0/token?grant_type=client_credentials&client_id=Va5yQRHl********LT0vuXV4&client_secret= 0rDSjzQ20XUj5i********PQSzr5pVw2&"
response = requests.get("https://openapi.baidu.com/oauth/2.0/token?grant_type=client_credentials&client_id=%s&client_secret=%s" %(API_KEY,SECRET_KEY))
print(response.content)
b'{"access_token":"24.29f64d7b0f0b66f7c1fc8705e41c2e28.2592000.1570788070.282335-17229182","session_key":"9mzdCS+Orh0\\/kZY28pY\\/hTUBatyStkJ68s\\/xO2mWt2thwQaGsclfsvIlxlkALA1u3H7Ryascku9qEcN\\/ivPRqrwwfKDo+g==","scope":"audio_voice_assistant_get brain_enhanced_asr audio_tts_post public brain_all_scope picchain_test_picchain_api_scope wise_adapt lebo_resource_base lightservice_public hetu_basic lightcms_map_poi kaidian_kaidian ApsMisTest_Test\\u6743\\u9650 vis-classify_flower lpq_\\u5f00\\u653e cop_helloScope ApsMis_fangdi_permission smartapp_snsapi_base iop_autocar oauth_tp_app smartapp_smart_game_openapi oauth_sessionkey smartapp_swanid_verify smartapp_opensource_openapi smartapp_opensource_recapi fake_face_detect_\\u5f00\\u653eScope","refresh_token":"25.78a76c8b55fface6a478d0f707c4082d.315360000.1883556070.282335-17229182","session_secret":"09c9f219f468a4f90773e5b7c46c8afb","expires_in":2592000}\n'
